package com.iam.core.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;

@Getter
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum SysLogType implements BaseEnum{
    /**
     *
     */
    SYSTEM(0, "系统日志"),AUTH(1, "认证日志");

    @EnumValue
    private Integer value;
    private String desc;

    SysLogType(Integer value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    @Override
    public Integer getValue() {
        return this.value;
    }

    public static SysLogType getEnumByValue(Integer value) {
        for (SysLogType e : SysLogType.values()) {
            if(e.getValue().equals(value)) {
                return e;
            }
        }
        return null;
    }
}
